package com.shioirikukuri.mapper;

import com.shioirikukuri.entity.Setmeal;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SetmealMapper {
	@Select("SELECT * FROM setmeal")
	List<Setmeal> selectAllSetmeals();

	@Select("SELECT * FROM setmeal WHERE id = #{id}")
	Setmeal selectSetmealById(Long id);

	@Insert("INSERT INTO setmeal(name, description, price) VALUES(#{name}, #{description}, #{price})")
	void insertSetmeal(Setmeal setmeal);

	@Update("UPDATE setmeal SET name=#{name}, description=#{description}, price=#{price} WHERE id=#{id}")
	void updateSetmeal(Setmeal setmeal);

	@Delete("DELETE FROM setmeal WHERE id=#{id}")
	void deleteSetmealById(Long id);
}